import Router from 'vue-router'
import Vue from 'vue'
import validator from "../components/element_ui/el_table/validator";
Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: 'Home',
            component: resolve => require(["@/components/Home"], resolve),
            children: [{
                path: '/vue',
                name: 'Vue',
                component: resolve => require(["@/components/vue_test/Vue_Test.vue"], resolve),
                children: [{
                    path: '/event',
                    name: 'Event',
                    component: resolve => require(["@/components/vue_test/event_test/EventDemo.vue"], resolve)
                }, {
                    path: '/filter',
                    name: 'Filter',
                    component: resolve => require(["@/components/vue_test/filter_demo/Filter_Demo.vue"], resolve)
                }, {
                    path: '/tocomponentcommunication',
                    name: 'ComponentCommunication',
                    component: resolve => require(["@/components/vue_test/component_communication/Father_Component.vue"], resolve)
                }]
            },
                {
                    path: '/vuex',
                    name: 'Vuex',
                    component: resolve => require(["@/components/vuex_test/VuexTest.vue"], resolve)
                },
                {
                    path: '/element-ui',
                    name: 'element-ui',
                    component: resolve => require(["@/components/element_ui/element-ui-index.vue"], resolve),
                    children: [{
                        path: '/el-table',
                        name: 'el-table',
                        component: resolve => require(["@/components/element_ui/el_table/validator.vue"], resolve),
                    }]
                },
                {
                    path: '/js',
                    name: 'js',
                    component: resolve => require(["@/components/js/js.vue"], resolve),
                    children: [{
                        path: '/session',
                        name: 'session',
                        component: resolve => require(["@/components/js/session/session.vue"], resolve),
                    }]
                }]
        }, {
            path: '/test',
            name: 'test',
            component: validator
        }
    ]
})
